package cn.jszx.core.controller;



import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import cn.jszx.core.bean.user.User;
import cn.jszx.core.service.user.UserService;


/**
 * 前台
 * 首页页面
 * 
 * @author cjw
 *
 */
@Controller
public class FrontIndexController {
	 private static Logger logger = LoggerFactory.getLogger(FrontIndexController.class);

	 @Autowired
		private UserService userService;
	//主页
	@RequestMapping(value = "/index.html")
	public String index(){
		logger.debug("=> indexPage");
		return "index";
	}
	@RequestMapping(value = "/loginPage.html")
	public String loginPage(){
		logger.debug("=> loginPage");
		return "index";
	}
	@RequestMapping(value = "/login.html")
	public String login(User user) {
		logger.debug(user.toString());
		userService.addUser(user);
		
	
		return "index";
	}
}
